home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / Arashi 1.1 Source / Game Source / jaf src / LogoEffects.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-02  |  3.0 KB  |  184 lines  |  [TEXT/KAHL]

  1. /*
  2. **  Logo effects.        //Jaf © copyright 1991
  3. */
  4.  
  5. #include "VA.h"
  6. #include "STORM.h"
  7. #include "flash.h"
  8.  
  9. #define MAXLOGOPOINTS 40             /* changed for ARASHI (mz) */
  10.  
  11. extern int stormxtable[];
  12. extern int stormytable[];
  13. extern int stormlinetable[][2];
  14. extern int logopoints;
  15. extern int logolines;
  16.  
  17. extern    int                MainStage;
  18. extern    int                SpecialEvent;
  19. extern    int                MaxScale;
  20. extern    VAColorInfo        *Col;
  21. extern    Handle            ColorHandle;
  22.  
  23. static    long            LogoFade;
  24. static    int                LogoCounter;
  25.  
  26. static    int             xtable[MAXLOGOPOINTS];
  27. static    int             ytable[MAXLOGOPOINTS];
  28.  
  29.  
  30. void RemoveLogoY()
  31. {
  32.     int        i,scale;
  33.     int        done;
  34.     
  35.     scale = MaxScale;
  36.     done = 1;
  37.     for(i=0;i<logopoints;i++) {
  38.         if (ytable[i]<scale*4) {    /* 50 */
  39.             ytable[i]+=1+(scale*4-ytable[i])/4;        /* 7 */
  40.             done = 0;
  41.             }
  42.         if (ytable[i]>2+scale*4) {    /* 54 */
  43.             ytable[i]-=1+(ytable[i]-scale*4-2)/4;
  44.             done = 0;
  45.             }
  46.     }
  47.     
  48.     DrawStormLogo(50,50);
  49.     DrawStormLogo(51,52);
  50.  
  51.     if(LogoCounter++ ==0)
  52.     {    VA.field=1;
  53.         VA.offset=0;
  54.         VA.color= 1;
  55.     
  56.         DrawStormLogoStatic(scale,50,50);
  57.         DrawStormLogoStatic(scale,50,52);
  58.     }
  59.  
  60.     if(done) 
  61.         SpecialEvent = LOGOREMOVEX;    
  62. }
  63.  
  64. void RemoveLogoX()
  65. {
  66.     int        i,x1,x2,y;
  67.     int        done,scale;
  68.     
  69.     done = 0;
  70.     VA.color=4;
  71.     scale = MaxScale;
  72.         
  73.     x1=50+xtable[0];
  74.     x2=50+41*scale-xtable[0];
  75.     xtable[0]+=scale*1.3;    /* 17 */
  76.     if(x1>=x2) 
  77.         done = 1;
  78.     y = 50+scale*4;
  79.     VALine(x1,y,x2,y); /* 102, 104 */
  80.     VALine(x1,y+2,x2,y+2);
  81.     if(done) {
  82.         SpecialEvent = NOEVENT;
  83.         PlayA(Blow,0);
  84.         VAExplosion(x1,y,3,4);
  85.         VAExplosion(x1,y+2,3,2);    
  86.     }
  87. }
  88.  
  89. void    DrawStormLogo(xoff,yoff)
  90. int        xoff,yoff;
  91. {
  92.     int        i;
  93.     int        a,b;
  94.     int        xtab[MAXLOGOPOINTS];
  95.     int        ytab[MAXLOGOPOINTS];
  96.  
  97.     VA.color=4;
  98.     for(i=0;i<logopoints;i++)
  99.     {    xtab[i]=xtable[i]+xoff;
  100.         ytab[i]=ytable[i]+yoff;    
  101.     }
  102.     for(i=0;i<logolines;i++)
  103.     {    a=stormlinetable[i][0];
  104.         b=stormlinetable[i][1];
  105.         VALine(xtab[a],ytab[a],xtab[b],ytab[b]);
  106.     }
  107. }
  108.  
  109. void    DrawStormLogoStatic(scale,xoff,yoff)
  110. int        scale,xoff,yoff;
  111. {
  112.     int        i,j;
  113.     int        a,b;
  114.     int        xtab[MAXLOGOPOINTS];
  115.     int        ytab[MAXLOGOPOINTS];
  116.  
  117.     for(i=0;i<logopoints;i++) {
  118.         xtab[i]=stormxtable[i]*scale+xoff;   
  119.         ytab[i]=stormytable[i]*scale+yoff;    
  120.     }
  121.     for(i=0;i<logolines;i++) {
  122.         a=stormlinetable[i][0];
  123.         b=stormlinetable[i][1];
  124.         VAStaticLine(xtab[a],ytab[a],xtab[b],ytab[b]);
  125.     }
  126. }
  127.  
  128. void Logo()
  129. {
  130.     int i;
  131.     
  132.     for(i=0;i<logopoints;i++) {
  133.         xtable[i]=stormxtable[i];
  134.         ytable[i]=stormytable[i];
  135.     }
  136.     (*Col)[7].red=0;
  137.     (*Col)[7].blue=0;
  138.     (*Col)[7].green=0;
  139.     VASetColors(ColorHandle);
  140.     SpecialEvent = LOGOSTART;
  141. }
  142.  
  143. void StartLogo()
  144. {
  145.     int        scale;
  146.     
  147.     scale = MaxScale;
  148.     VA.field=1;
  149.     VA.offset=0;
  150.     LogoFade = 1024;
  151.  
  152.     DrawStormLogoStatic(scale,50,50);
  153.     DrawStormLogoStatic(scale,50,52);
  154.     SpecialEvent = LOGOLIVING;
  155. }
  156.  
  157. void DrawLogo()
  158. {    
  159.     int        i,scale;
  160.         
  161.     LogoFade += 900;    /* 1024 */
  162.     if (LogoFade<65536) {
  163.         (*Col)[7].red=0;
  164.         (*Col)[7].blue=LogoFade;
  165.         (*Col)[7].green=LogoFade;
  166.         VASetColors(ColorHandle);
  167.     }
  168.     else {    
  169.         scale = MaxScale;
  170.         SpecialEvent = LOGOREMOVEY;
  171.         
  172.         for(i=0;i<logopoints;i++) {
  173.             xtable[i]=stormxtable[i]*scale;  
  174.             ytable[i]=stormytable[i]*scale;    
  175.         }
  176.  
  177.         DrawStormLogo(50,50);
  178.         DrawStormLogo(51,52);
  179.         
  180.         LogoCounter=0;
  181.     }
  182. }
  183.  
  184.